<?php

namespace App\Traits\GetLibrary;


use App\Library\AliYun\AliYunCloud\AliYunCloudApi;
use App\Library\Express\ExpressApi;
use App\Library\Tencent\TencentCloud\TencentCloudApi;
use App\Library\Wechat\WechatApi;
use Exception;

trait GetApiLibrary
{
    /**
     * @return TencentCloudApi
     * @throws Exception
     */
    public function getTencentCloudLibrary(): TencentCloudApi
    {
        return loadLibrary('Tencent\TencentCloud\TencentCloudApi');
    }

    /**
     * @return WechatApi
     * @throws Exception
     */
    public function getWechatApi(): WechatApi
    {
        return loadLibrary('Wechat\WechatApi');
    }

    /**
     * @return AliYunCloudApi
     * @throws Exception
     */
    public function getAliYunCloudLibrary(): AliYunCloudApi
    {
        return loadLibrary('AliYun\AliYunCloud\AliYunCloudApi');
    }

    /**
     * @return ExpressApi
     * @throws Exception
     */
    public function getExpressApi(): ExpressApi
    {
        return loadLibrary('Express\ExpressApi');
    }
}
